CS450-FALL 2005

Homework Assignment # 1

Due – SEPTEMBER 11 , 2005  11:59 P.M.

 

The following directions apply to all assignments:

 

IMPORTANT: FOLLOW THE FOLLOWING DIRECTIONS OR YOU RISK OF HAVING YOUR SUBMISSION NOT GRADED!!!!!!!!

 

1.     Submit homework/project assignments to BLACKBOARD’s DIGITAL DROP BOX only . Include your source code files, WHEN APPLICABLE, compiled code, WHEN APPLICABLE, executables, WHEN APPLICABLE, README file WHEN APPLICABLE, WORD file with your text type answers etc as required (see 3 below).

 

2.     At the top of each source code file (if code is involved) include the following comments: //Author: Your name //

          Student ID: your school ID// Assignment # : ___ // Problem#___//Date:

 

3.     All assignments should include a WORD file named with the same name you use for the zipped name (see

           item 4). In the WORD file include : YOUR NAME, YOUR STUDENT ID, YOUR

          ASSIGNMENT #, DATE SUBMITTED. 

This WORD file also has the text answers to assignments or answers to project questions other than code (i.e. text exercises).

 Include any data if the assignment requires it. Any additional comments can be included in the WORD file

 (for example special instructions as to how to execute your program IN CASE OF A PROJECT).

 

4.     Create a folder and include all the assignment files in that folder. Name that folder the same name as the zipped file described next. Zip all files and use the following convention to name the zipped file: yourlastname_assignment#.zip (for projects use yourlastname_project#.zip). Upload the zipped file to the digital drop box of Blackboard.

 

5. In addition, for any programs that involve executables or any script programs do the following: The source file and the executable file need to be stored in your UNIX account on the UNIX server. As part of checking your work the TA or I will try to execute your code from there. If your executable file is not there YOU WILL LOOSE THE POINTS. Make sure that the proper permissions have been issued at the file level and at the directory level (if you created a new directory in your account). Use 777 for permissions thus giving permissions to everybody. If your program does not execute, you loose the points.

 

NOTE:  ASSIGNMENTS ARE BASED ON BOTH THE TEXT AND ANY HANDOUTS PRESENT ON THE COURSE”S WEB SITE

 

PROBLEM 1 (1 point) ------Answer the following questions pertaining to hardware developments over the years.

1.                       Name 6 technological advances in hardware and the year in which they were invented (for one of the advances you can mention the decade only), in the early stages of computing (late 40s and 50s), which helped in the advancement of computer hardware designs.

2.                       Name all the microprocessors mentioned in the hardware history document (name at least 5), the year they were introduced and the computer name or type that they were used for originally.

3.                       Outline 5 Mainframe computers, the name of the company that introduced them and the year introduced (or the approximate period) some narrative about the design and intended usage.

4.                       The UNIVAC-1 was introduced in 1954. Using figure 1 in one of the supplied articles identify the expected Floating Point Operations (FLOPS) rate (give an approximate range) of a computer designed in 2004.

 

 

PROBLEM 2 (1 point)----- Answer the following questions pertaining to the development of Operating Systems over the years.

1.                      Read the development of the Operating Systems Windows, and UNIX during the 1980’s. Discuss the reasons Windows was developed and why it caught on so fast. Who was the primary user of Windows in the 1980s? Why was UNIX still being advanced and who was the primary user of UNIX in the 1980s?  List the major events that affected UNIX in the period 1980-1990 (other than simple releases) and the dates of those events.

2.                      By doing some research on the Internet identify the goals of GNU manifesto. Give a short history of its development and purpose. Identify its differences over “normal” UNIX. The inventor was Richard Stallman, a researcher who originally worked at MIT. Limit your answer to about half of a typed page.

 

 

PROBLEM 3 (1 point)

1.      Do exercise 1.5 from text

2.      Do exercise 2.3 from text

                       

 

PROBLEM 4 (1 point1)

1.      Do exercise 2.6 from text

2.      Do exercise 2.7 from text

 

PROBLEM 5 (1 point)

1.      Do exercise 2.10 from text

2.      Do exercise 2.14 from text

 

PROBLEM 6 (2.5 point)

 

 

                        Write a script for UNIX Bash shell that performs as a calculator. Name the script file calc.src.

Command structure: $./calc.src [optiuoins] arg1 arg2 filename.txt

Script functionality: Adds, subtracts, multiplies, divides, or gives the remainder of a division if asked in the options part of the command. The user provides two integers (they can be negative) on arguments 2 and 3. Argument 4 is the name of the file that the user designates for the results to be stored. The integers provided by the user and the result also appears on the screen.

                        Command structure options:  

§          -a  means add

§         -s means subtract

§         -m means multiply

§         -q means quotient

§         -r menas remainder

Your program first validates by making sure that the user entered the proper arguments. If not then a message is shown on the screen indicating the error.

Your program also checks to make sure that the file designated by the user has write and read rights and if not it sets the rights to read and write for all users and groups.    

Example: # ./calc.rsc  –a  a  3  add.dat  Output: # Error a is not numeric file was not created

Example: #./ calc.src  –a  3  2 add.dat   Output # 3+2 = 5  . In addition, a file add.dat is created on the current directory with its contents being: 3+2=5

Example: # calc –r  7  3  remainder.dat  Output #  7 % 3 is 1. The same result is stored in the file remainder.dat

 

PROBLEM 7 (2.5 point)

 

Write a script program for Bash shell that manipulates strings provided in a file called test.txt using the grep family of commands. Name the script file greptests.src

                        Command structure: $./greptest.src.src [options] test.txt filename.txt

                        Options:

                                    -ch  select the lines from file test.txt that have at least 5 characters. Print results on the screen and in the file provided by user.

 

                                    -un select the lines from file test.txt that have the string UNIX. Print results on the screen and in the file provided by the user.

                       

                        Arg1: test.txt is the file that contains the following text (you need to create it):

 

                                    A

                                    ABC

                                    AC

                                    The operating system is UNIX

                                    The system responds well if the program is written in UNIX commands

                                    UNIX is UNIX

                                    I am me

                        Arg2: filename.txt is the file name provided by the user.

As usually your program should validate the number of arguments provided by the user and the correct options symbol. The proper permissions should be issued for the files created.